package hiho.week._67;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int w = in.nextInt();
		
		int[] f= new int[w + 1];
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			int b = in.nextInt();
			for (int j = w; j >= b; j--) {
				int _a = a;
				int _b = b;
				int cost = b;
				while (cost <= j) {
					f[j] = Math.max(f[j], f[j - cost] + _a);
					_b *= 1.07;
					_a += a;
					cost += _b;
				}
			}
		}
		
		System.out.println(f[w]);
	}

}
